/*
 * SonarQube
 * Copyright (C) 2009-2021 SonarSource SA
 * mailto:info AT sonarsource DOT com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */
.menu {
  min-width: 160px;
  padding: 5px 0;
  list-style: none;
  font-size: var(--smallFontSize);
  text-align: left;
  background-color: #fff;
  background-clip: padding-box;
}

.menu:focus {
  outline: none;
}

.menu.is-container {
  padding: 5px;
}

.menu-item,
.menu > li > a,
.menu > li > button,
.menu > li > span {
  display: block;
  padding: 4px 16px;
  line-height: 14px;
  clear: both;
  font-weight: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu > li > a {
  color: var(--baseFontColor);
  border-bottom: none;
  transition: none;
}

.menu > li > button {
  color: var(--baseFontColor);
  text-align: left;
  width: 100%;
}

.menu > li > a.rich-item {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray80);
  border-radius: 4px;
  margin: 4px 10px;
  padding: 2px 8px;
  white-space: normal;
}

.menu .divider {
  height: 1px;
  margin: 6px 0;
  overflow: hidden;
  background-color: var(--barBorderColor);
}

.menu > li > a.disabled {
  color: var(--disableGrayText) !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.menu > li > a.text-muted {
  color: var(--secondFontColor);
}

.menu > li > a:hover,
.menu > li > a:focus,
.menu > li > button:hover,
.menu > li > button:focus {
  text-decoration: none;
  color: var(--baseFontColor);
  background-color: var(--barBackgroundColor);
}

.menu > .active > a,
.menu > li > .active,
.menu > .active > a:hover,
.menu > li > .active:hover,
.menu > .active > a:focus,
.menu > li > .active:focus {
  color: var(--baseFontColor);
  text-decoration: none;
  outline: 0;
  background-color: var(--barBackgroundColor);
}

.menu .menu-vertically-limited,
.menu.menu-vertically-limited {
  max-height: 300px;
  overflow-y: auto;
}

.menu-vertically-limited.with-top-separator {
  border-top: 1px solid #e6e6e6;
}

.menu-vertically-limited.with-bottom-separator {
  border-bottom: 1px solid #e6e6e6;
}

.menu .menu-footer > a > span {
  border-bottom: 1px solid var(--gray80);
  color: var(--secondFontColor);
}

.menu .menu-footer-note {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu .menu-footer.active .menu-footer-note {
  opacity: 1;
}

.menu-search {
  position: relative;
  padding: var(--gridSize) calc(2 * var(--gridSize)) 0;
}

.menu-search .search-box,
.menu-search .search-box-input {
  max-width: none;
  min-width: 240px;
}

.menu-search ~ .menu > li > a:hover,
.menu-search ~ .menu > li > a:focus {
  background-color: transparent;
}

.menu-search ~ .menu > .active > a,
.menu-search ~ .menu > li > .active,
.menu-search ~ .menu > .active > a:hover,
.menu-search ~ .menu > li > .active:hover,
.menu-search ~ .menu > .active > a:focus,
.menu-search ~ .menu > li > .active:focus {
  background-color: var(--barBackgroundColor);
}

.menu-message {
  display: block;
  padding: 4px 16px;
  line-height: 16px;
}

.menu-header {
  padding: var(--gridSize);
  font-size: 12px;
  color: #777;
  white-space: nowrap;
}

.menu-header:first-child,
.divider + .menu-header {
  padding-top: calc(var(--gridSize) - 5px);
}
